﻿<Page x:Class="WpfBrush.LinerGradientBrushSample"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="311" d:DesignWidth="614"
	Title="LinerGradientBrush">

    <Grid>
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="27,25,0,0"  Text="MappingMode:  RelativeToBoundingBox" VerticalAlignment="Top" Width="306" >
            <TextBlock.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"  MappingMode="RelativeToBoundingBox">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop  Offset="0.1" Color="LightSalmon" />
                        <GradientStop  Offset="0.9" Color="LightGreen" />
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </TextBlock.Background>
        </TextBlock>

        <TextBlock Height="23" HorizontalAlignment="Left" Margin="27,66,0,0"  Text="MappingMode:Repeat" VerticalAlignment="Top" Width="306" >
            <TextBlock.Background>
                <LinearGradientBrush StartPoint="0,0" EndPoint=".5,0"    SpreadMethod="Repeat">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop  Offset="0.2" Color="Gold" />
                        <GradientStop  Offset=".9" Color="LightGreen" />
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </TextBlock.Background>
        </TextBlock>
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="27,111,0,0" Text="SpreadMethod:Pad"
                   VerticalAlignment="Top" Width="306">
            <TextBlock.Background>
                <LinearGradientBrush EndPoint=".5,0" SpreadMethod="Pad" StartPoint="0,0">
                    <GradientStop Color="Gold" Offset="0.2" />
                    <GradientStop Color="LightGreen" Offset=".9" />
                </LinearGradientBrush></TextBlock.Background>
        </TextBlock>
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="27,160,0,0" Text="SpreadMethod:Reflect" VerticalAlignment="Top" Width="306">
            <TextBlock.Background>
                <LinearGradientBrush EndPoint=".5,0" SpreadMethod="Reflect" StartPoint="0,0">
                    <GradientStop Color="Gold" Offset="0.2" />
                    <GradientStop Color="LightGreen" Offset=".9" />
                </LinearGradientBrush>
            </TextBlock.Background>
        </TextBlock>

        <TextBlock Height="23" HorizontalAlignment="Left" Margin="27,160,0,0"  VerticalAlignment="Top" Width="306">
            <TextBlock.Background>
                <LinearGradientBrush EndPoint=".5,0" SpreadMethod="Reflect" StartPoint="0,0">
                    <GradientStop Color="Gold" Offset="0.2" />
                    <GradientStop Color="LightGreen" Offset=".2" />
                </LinearGradientBrush>
            </TextBlock.Background>
        </TextBlock>
    </Grid>
</Page>
